GDK W32: Fix positioning of reparented window
authorJeremy Tan <jtanx@outlook.com>
Fri, 15 Apr 2016 11:22:20 +0000 (19:22 +0800)
committerРуслан Ижбулатов <lrn1986@gmail.com>
Fri, 15 Apr 2016 13:21:11 +0000 (13:21 +0000)
MoveWindow should not be used over the pre-existing move/resize
functions, which already correctly position a window with respect
to its parent, while also taking into account the size of window
decorations.

https://bugzilla.gnome.org/show_bug.cgi?id=765100

gdk/win32/gdkwindow-win32.c

index 9815199b0c8e5834f9fb042308fe97f5ce06c4dd..6668cd659b134ea674118507786f9f3cc00c5602 100644 (file)
@@ -1706,9 +1706,6 @@ gdk_win32_window_reparent (GdkWindow *window,
   API_CALL (SetParent, (GDK_WINDOW_HWND (window),
                        GDK_WINDOW_HWND (new_parent)));
 
-  API_CALL (MoveWindow, (GDK_WINDOW_HWND (window),
-                        x, y, window->width, window->height, TRUE));
-
   /* From here on, we treat parents of type GDK_WINDOW_FOREIGN like
    * the root window
    */
@@ -1741,6 +1738,9 @@ gdk_win32_window_reparent (GdkWindow *window,
        }
     }
 
+  /* Move window into desired position while keeping the same client area */
+  gdk_win32_window_move_resize (window, TRUE, x, y, window->width, window->height);
+
   return FALSE;
 }